import React, { Component } from 'react'

export default class App extends Component {
  testRef = React.createRef()
  render() {
    return (
      <div>
        <input type="text" ref={ this.testRef } defaultValue = "你好"/>
        <button onClick = { 
          () => {
            console.log(this.testRef.current.value)
          }
        }>获取</button>
      </div>
    )
  }
}
